package com.loja.instrumento.model;




import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.Table;





@Entity
@Table(name="Cliente")
public class Cliente {


	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private int id;
	@Column(name="name",length=100)
	private String nome;
	@Column(name="telefone",length=100)
	private String telefone;
	@Column(name="saldo",length=100)
	private BigDecimal saldo;

	@OneToMany(cascade = CascadeType.ALL, mappedBy="id")
	private List<Instrumento> instrumento=new ArrayList<Instrumento>();
	

	public int getId() {
		return id;
	}
	public void setId(int  id) {
		this.id = id;
	}
	public String getNome() {
		return nome;
	}
	public void setNome(String nome) {
		this.nome = nome;
	}
	public String getTelefone() {
		return telefone;
	}
	public void setTelefone(String telefone) {
		this.telefone = telefone;
	}
	public BigDecimal getSaldo() {
		return saldo;
	}
	public void setSaldo(BigDecimal saldo) {
		this.saldo = saldo;
	}
	
	public List<Instrumento> getInstrumento ()
	{
		return instrumento ;
	}
	public void setValorInstrumento(Instrumento instrumento)
	{
		this.instrumento.add(instrumento);
	}
	public void setInstrumento(List<Instrumento> instrumento) {
		this.instrumento = instrumento;
	}
	
}
